<?php
/**
 * Created by PhpStorm.
 * User: EDZ
 * Date: 2020/6/22
 * Time: 14:45
 */

namespace DesignPatterns\Creative\AbstractFactory;

use utils\Str;

class FactoryProducer
{
    public static function getFactory(string $choice) : AbstractFactory {
        if (Str::equalsIgnoreCase($choice, "SHAPE")) {
            return new ShapeFactory();
        } else if (Str::equalsIgnoreCase($choice, "COLOR")) {
            return new ColorFactory();
        }
        return null;
    }
}